<?php
		$root_path="../../../";
		require("../dbconnect.php");
		require("../function.php");

		$mainCat=$_GET["mainCat"];
		$value=$_GET["value"];
		
		
		$chk=mysql_query("select count(*) as result from os_sub_category where name_eng='$value' and main_category='$mainCat'")or die(mysql_error());
		if(mysql_result($chk,0,"result")==0)
		{
			echo "<div class='dw_success'>Category name is available</div>";
		}
		else
		{
			echo "<div class='dw_failed'>Category name already exist under this main category !</div>";
		}
		
?>